<template>
	<view class="new-detail-box">
		<view class="news-detail-title">
			<text :class="'fontType' + page_data.fonttype"
				:style="{color:page_data.titlecolor}">{{page_data.title}}</text>
		</view>
		<view class="news-detail-time">
			<text>{{page_data.created_at}}</text>
		</view>
		<view class="news-detail-content" v-if="page_data.news_content ">
			<u-parse :html="page_data.news_content.content"></u-parse>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				page_data: {

				}
			}
		},
		onShow() {
			this.fetchNewsDetail();
		},

		methods: {
			fetchNewsDetail() {
				let params = {
					id: this.$Route.query.id
				}
				this.$http('news.detail', params).then(res => {
					if (res.code == 1) {
						this.page_data = res.data
					}
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #fff;
	}
</style>
<style lang="scss" scoped>
	.new-detail-box {
		padding: 20rpx;

		.news-detail-title {
			padding: 40rpx 0;
			font-size: 40rpx;
			text-align: center;
		}

		.news-detail-time {
			text-align: center;
			padding: 20rpx 0;
		}
	}

	.fontType1 {
		font-weight: bold;
	}

	.fontType2 {
		font-style: oblique;
	}

	.fontType3 {
		font-weight: bold;
		font-style: oblique;
	}

	.news-detail-content /deep/ img {
		display: block;
		max-width: 100%;
		width: 100%;
		margin: 30rpx auto;
	}
</style>
